<%@page contentType="text/html; charset=utf-8" %>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/messages.jsp"%>
<%@ include file="/commons/commonEdit.jsp" %>
<%@ include file="/commons/validation.jsp" %>
<%@ include file="/commons/dateTime.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>登记申报项目</title>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script>
var flag = null;
function next(url){
	window.location.href = url;
}
function setPerfectItemTypeName(thiz){
	$('perfectItemTypeConfigName').value=thiz.options[thiz.selectedIndex].text;
}
function addRectificate(){
	var isTrue=$('rectificateForm').fireEvent("onSubmit") ;
    if(isTrue){
        var param = Form.serialize('rectificateForm');
        var url = null;
		if(flag == "add")
		   url = "${ctx}/occupation_joinHandleAction.do?method=addPerfectItemRequistion";
		else
		   url="${ctx}/occupation_joinHandleAction.do?method=editPerfectItemRequistion";
       new Ajax.Request(url,{method: 'post',parameters :param ,onSuccess : showResult});
	}
}
function showResult(){
	var obj=findFrame('rectificateMain');
	obj.reloadRectificateList();
	windowClose();
	//
}
</script>
</head>

<body onload="init('${flag }')">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle" /> <span class="window_head_intext" id="window_title"></span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td colspan="2" class="content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="aux_outtable_color">
        <form action="${ctx}/occupation_joinHandleAction.do?method=addPerfectItemRequistiont" name="rectificateForm" method="post" class="required-validate">
        <input type="hidden" name="keyword" value="${perfectItemRequisition.keyword }">
        <input type="hidden" id="index" name="index" value="${perfectItemRequisition.index}">
        <input type="hidden" name="houseNumber" value="${perfectItemRequisition.houseNumber}">
        <input type="hidden" name="ownerName" value="${perfectItemRequisition.ownerName}">
        <input type="hidden" name="joinMode" value="${perfectItemRequisition.joinMode}">
        <input type="hidden"  name="perfectItemTypeConfigName" value="${perfectItemRequisition.perfectItemTypeConfigName}">
        <input type="hidden" name="inspectionRequisitionId" value="${perfectItemRequisition.inspectionRequisitionId }">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
           <tr>
            <td class="aux_intable_td1">申报日期：</td>
            <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><input name="perfectRequisitionDate" type="text"
                           class="required validate-date-yyyy-MM-dd validate-ajax" replaceId="dataValue"
                   		   validateUrl="${ctx}/common_sysrefcodeAction.do?method=compareCurrentDate&dateFormat=yyyy-MM-dd&compareType=smallEqualsCurrentDate" validateMessage="输入的申报日期必须小于等于当前系统时间"
                           value="<fmt:formatDate value='${perfectItemRequisition.perfectRequisitionDate }' pattern='yyyy-MM-dd'/>" size="16" maxlength="10" afterInsert="dateAfter"/></td>
                <td width="4">&nbsp;</td>
                <td><img name="perfectRequisitionDateButton" src="${ctx}/images/ico_clock.gif" width="20" height="20" /><span id="dateAfter"></span></td>
              </tr>
            </table></td>
            </tr>
			<tr>
            <td class="aux_intable_td1">申报类型：</td>
            <td class="aux_intable_require"><pms:unitedSelect
             		name="perfectItemTypeConfigId"
             		optionLabel="perfectItemTypeName"
             		optionValue="keyword"
             		selectText="请选择"
             		className="select-one-required"
             		onChange="setPerfectItemTypeName(this)"
             		dataList="${perfectItemTypeConfigList}"
             		value="${perfectItemRequisition.perfectItemTypeConfigId }"
             		style="width:110px;">
            </pms:unitedSelect></td>
            </tr>
			<tr>
            <td valign="top" class="aux_intable_td1">问题描述：</td>
            <td class="aux_intable_require_more">
              <textarea name="description" cols="26" rows="3" class="required max-length-200" >${perfectItemRequisition.description }</textarea></td>
            </tr>
			<tr>
            <td valign="top" class="aux_intable_td1">期望结果：</td>
            <td class="aux_intable_td2">
              <textarea name="expectationResult" cols="26" rows="3" class="max-length-100">${perfectItemRequisition.expectationResult }</textarea></td>
            </tr>
        </table>
        </form>
        </td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table border="0" cellpadding="0" cellspacing="0" onclick="addRectificate()">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22"  onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onBlur="btn_change(2)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 确 定</td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onBlur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<script type="text/javascript">
Calendar.setup(
              {
	              inputField : "perfectRequisitionDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "perfectRequisitionDateButton", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
function init(editFlag){
	if(editFlag == 'add'){
		$('window_title').innerText =  "登记申报项目";
		flag = "add";
	}else if(editFlag == 'update'){//update
		$('window_title').innerText = "修改申报项目";
		flag = "update";
	}
}
</script>
</body>
</html>